package com.mall.mapper;

import com.aliyuncs.ram.model.v20150501.CreateAccessKeyRequest;
import com.mall.dto.*;
import com.mall.entity.CmsPrefrenceAreaProductRelation;
import com.mall.entity.CmsSubjectProductRelation;
import com.mall.entity.PmsProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.entity.PmsSkuStock;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品信息 Mapper 接口
 * </p>
 *
 * @author zzx
 * @since 2022-06-15
 */
@Mapper
public interface PmsProductMapper extends BaseMapper<PmsProduct> {
    /**
     * 获取商品编辑信息
     */
    PmsProductResult getUpdateInfo(@Param("id") Long id);
    /**
     * 条件查询商品
     */
    List<PmsProduct> getList(@Param("queryParam") PmsProductQueryParam queryParam);

    CmsSubjectProductRelation selectSubjectProductRelationByProductId(@Param("productId") Long productId);

    CmsPrefrenceAreaProductRelation selectPrefrenceAreaProductRelationByProductId(@Param("productId") Long productId);

    List<FrontCateAttributeDto> getFrontCateAttributeList(@Param("cid") Long cid);

    List<FrontCommentDto> getFrontCommentList(@Param("productId") Long productId);

    int createComment(@Param("productId") Long productId, @Param("memberId") Long memberId,  @Param("content") String content, @Param("star") int star, @Param("date") String date);
}
